<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@include file="../../common/common.jspf"%>
<link rel="stylesheet" href="${ctx}/css/promotion/promotion.css"  media="all">	
<script type="text/javascript" src="${ctx}/js/promotion/detail/edit.js"></script>

<style type="text/css">
.col-sm-3 {
	width: 15%;
	float: left;
}

.col-sm-9 {
	width: 85%;
	float: left;
}
</style>
</head>
<body>
	<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
	<form id="form" name="form" class="form-horizontal" method="post" style="width:95%;margin-left: 25px;"
		action="${ctx}/promotion/detail/updateProDetail">
		<input type="hidden" value="${promotionDetail.id}" name="id" id="id">
		<input type="hidden" value="${promotionDetail.pro_id}" name="pro_id" id="pro_id">	
		<input type="hidden" value="${promotionDetail.pro_type}" name="pro_type" id="$pro_type">
		<section class="panel panel-default">
		<div class="panel-body">
			<div class="form-group">
				<label class="col-sm-3 control-label">促销类型</label>
				<div class="col-sm-9">
					<select class="form-control" name="pro_type" id="pro_type" disabled="disabled">
						<option value="">请选择</option>
						<%-- <c:forEach var="item" items="${goodsUnitList}"> --%>
							<%-- <option value="${item.id}" <c:if test="${item.id==goods.unit}">selected</c:if>>${item.name}</option> --%>
						<%-- </c:forEach> --%>
						<option value="0" <c:if test="${promotionDetail.pro_type=='0'}">selected</c:if>>订单满减</option>
						<option value="1" <c:if test="${promotionDetail.pro_type=='1'}">selected</c:if>>商品满减</option>
						<option value="2" <c:if test="${promotionDetail.pro_type=='2'}">selected</c:if>>商品满赠</option>
						<option value="3" <c:if test="${promotionDetail.pro_type=='3'}">selected</c:if>>商品打折</option>
					</select>
				</div>
			</div>
			<div class="line line-dashed line-lg pull-in"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label" >促销活动</label>
				<div class="col-sm-9">
				    <input type="text" class="form-control" placeholder="请输入促销名称" disabled="disabled" value="${promotionDetail.pro_title}" name="pro_title" id="pro_title" maxlength="32">
				</div>
			</div>
			<div class="line line-dashed line-lg pull-in"></div>
			<div class="form-group">
				<label class="col-sm-2 control-label">促销开始时间</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" placeholder="请选择促销开始时间" disabled="disabled" value="<fmt:formatDate value="${promotionDetail.pro_start}" type="date" pattern="yyyy-MM-dd HH:mm:ss"/>" name="pro_start" id="pro_start" maxlength="40">
				</div>
				<label class="col-sm-2 control-label">促销结束时间</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" placeholder="请选择促销结束时间" disabled="disabled" value="<fmt:formatDate value="${promotionDetail.pro_end}" type="date" pattern="yyyy-MM-dd HH:mm:ss"/>" name="pro_end" id="pro_end" maxlength="30">
				</div>
			</div>
		<div class="line line-dashed line-lg pull-in orderSalesAmount" style="<c:if test="${promotionDetail.pro_type=='0'}">display:bolck</c:if><c:if test="${promotionDetail.pro_type!='0'}">display:none</c:if>" ></div>
	    <div class="form-group orderSalesAmount"  id="orderSalesAmount" style="<c:if test="${promotionDetail.pro_type=='0'}">display:bolck</c:if><c:if test="${promotionDetail.pro_type!='0'}">display:none</c:if>">
			<div class="col-sm-3">
				<label class="control-label" style="float: right;">订单满减(￥)</label>
			</div>
			<div class="col-sm-9">
				<div class="col-sm-1">
					<label class="control-label" style="float: right;"><font color="red">购买金额≥</font></label>
				</div>
				
				<div class="col-sm-5">
				    <input class="form-control" placeholder="请输入购买金额" name="pro_money_m" id="pro_money_m" type="text" value="${promotionDetail.pro_money_m}">		
				</div>
				<div class="col-sm-1">
					<label class="control-label" style="float: right;"><font color="red">减</font></label>
				</div>
				<div class="col-sm-4">
				     <input class="form-control" placeholder="请输入减少金额" name="pro_money_s" id="pro_money_s" type="text" value="${promotionDetail.pro_money_s}">
				</div>		
				<div class="col-sm-1">
				   <label class="control-label" style="float: left;"><font color="red">元</font></label>
				</div>
			</div>
		</div>
		<div class="line line-dashed line-lg pull-in productsReduction" style="<c:if test="${promotionDetail.pro_type=='1'}">display:bolck</c:if><c:if test="${promotionDetail.pro_type!='1'}">display:none</c:if>"></div>	
		<div class="form-group productsReduction" id ="productsReduction" style="<c:if test="${promotionDetail.pro_type=='1'}">display:bolck</c:if><c:if test="${promotionDetail.pro_type!='1'}">display:none</c:if>">
			<div class="col-sm-3">
				<label class="control-label" style="float: right;">商品满减(￥)</label>
			</div>
			<div class="col-sm-9">
				<div class="col-sm-1">
					<label class="control-label" style="float: right;"><font color="red">购买金额≥</font></label>
				</div>
				
				<div class="col-sm-5">
				    <input class="form-control" placeholder="请输入购买金额" name="pro_money_m_mj" id="pro_money_m_mj" type="text" value="${promotionDetail.pro_money_m}">		
				</div>
				<div class="col-sm-1">
					<label class="control-label" style="float: right;"><font color="red">减</font></label>
				</div>
				<div class="col-sm-4">
				     <input class="form-control" placeholder="请输入减少金额" name="pro_money_s_mj" id="pro_money_s_mj" type="text"  value="${promotionDetail.pro_money_s}">
				</div>				
				<div class="col-sm-1">
				   <label class="control-label" style="float: left;"><font color="red">元</font></label>
				</div>
			</div>
		</div>
		<div class="line line-dashed line-lg pull-in productsGift" style="<c:if test="${promotionDetail.pro_type=='2'}">display:bolck</c:if><c:if test="${promotionDetail.pro_type!='2'}">display:none</c:if>"></div>	
		<div class="form-group productsGift" id ="productsGift" style="<c:if test="${promotionDetail.pro_type=='2'}">display:bolck</c:if><c:if test="${promotionDetail.pro_type!='2'}">display:none</c:if>">
			<div class="col-sm-3">
				<label class="control-label" style="float: right;">商品满赠(个)</label>
			</div>
			<div class="col-sm-9">
				<div class="col-sm-1">
					<label class="control-label" style="float: right;"><font color="red">购买数量≥</font></label>
				</div>
				
				<div class="col-sm-5">
				    <input class="form-control" placeholder="请输入商品数量" name="pro_count_m" id="pro_count_m_mz" value="${promotionDetail.pro_count_m}" type="text">		
				</div>
				<div class="col-sm-1">
					<label class="control-label" style="float: right;"><font color="red">送</font></label>
				</div>
				<div class="col-sm-4">
				     <input class="form-control" placeholder="请输入赠送数量" name="pro_count_s" id="pro_count_s_mz" value="${promotionDetail.pro_count_s}" type="text">
				</div>		
				<div class="col-sm-1">
				   <label class="control-label" style="float: left;"><font color="red">个</font></label>
				</div>
			</div>
		</div>
		<div class="line line-dashed line-lg pull-in freeGoods" style="<c:if test="${promotionDetail.pro_type=='2'}">display:bolck</c:if><c:if test="${promotionDetail.pro_type!='2'}">display:none</c:if>"></div>	
		<div class="form-group freeGoods" id="freeGoods"  style="<c:if test="${promotionDetail.pro_type=='2'}">display:bolck</c:if><c:if test="${promotionDetail.pro_type!='2'}">display:none</c:if>">
			<div class="col-sm-3"> 
				<label class="control-label" style="float: right;">选择赠送商品</label>
			</div>
			<div class="col-sm-9">
			    <button class="btn btn-info" type="button" id="selectGoods" >选择赠送商品</button> 
			</div>
		</div>
		<div class="form-group freeGoods"  style="<c:if test="${promotionDetail.pro_type=='2'}">display:bolck</c:if><c:if test="${promotionDetail.pro_type!='2'}">display:none</c:if>">
			<div class="col-sm-3"> 
				<label class="control-label" style="float: right;">商品列表</label>
			</div>
			<div class="col-sm-9">
				 <input type="hidden"  name ="pro_goods" id="pro_goods" value="${promotionDetail.pro_goods}"/>
				<ul class="list-group"  id="prodctsitems">
					  <c:forEach var="item" items="${promotionDetail.goodsList}">
							 <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button>商品名称：${item.name }</li>
					 </c:forEach>
				   <!--  <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button>商品名称：环奇630遥控车 </li>
				    <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button>商品名称：环奇630遥控车</li>
				    <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button>商品名称：环奇630遥控车</li>
				    <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button> 商品名称：环奇630遥控车</li>
				    <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button>商品名称：环奇630遥控车</li>
				    <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button> 商品名称：环奇630遥控车</li> -->
				</ul>  
			</div>
		</div>		
		<div class="line line-dashed line-lg pull-in proDiscountRate" style="<c:if test="${promotionDetail.pro_type=='3'}">display:bolck</c:if><c:if test="${promotionDetail.pro_type!='3'}">display:none</c:if>"></div>	
		<div class="form-group proDiscountRate" id ="proDiscountRate" style="<c:if test="${promotionDetail.pro_type=='3'}">display:bolck</c:if><c:if test="${promotionDetail.pro_type!='3'}">display:none</c:if>">
			<div class="col-sm-3">
				<label class="control-label" style="float: right;">商品打折(%)</label>
			</div>
			<div class="col-sm-9">
				<div class="col-sm-1">
					<label class="control-label" style="float: right;"><font color="red">购买数量≥</font></label>
				</div>				
				<div class="col-sm-5">
				    <input class="form-control" placeholder="请输入商品数量" name="pro_count_m_dz" value="${promotionDetail.pro_count_m}" id="pro_count_m_dz" type="text">		
				</div>
				<div class="col-sm-1">
					<label class="control-label" style="float: right;"><font color="red">促销折扣率</font></label>
				</div>				
				<div class="col-sm-4">
				    <div class="input-group spinner">  
				    <input type="text" class="form-control" name="pro_rate" id="pro_rate" value="${promotionDetail.pro_rate}" placeholder="请输入折扣率">
				    <div class="input-group-btn-vertical">  
				      <button class="btn btn-default" type="button" id="addRate"><i class="fa fa-caret-up"></i></button>  
				      <button class="btn btn-default" type="button" id="subRate"><i class="fa fa-caret-down"></i></button>  
				    </div>  
				  </div>  	
				</div>				
				<div class="col-sm-1">
					<label class="control-label" style="float: left;"><font color="red">%</font></label>
				</div>	
			</div>
		</div>
		<div class="line line-dashed line-lg pull-in"></div>	
		<div class="form-group">
			<div class="col-sm-3">
				<label class="control-label" style="float: right;">促销说明</label>
			</div>
			<div class="col-sm-9">				
				<textarea rows="3" cols="5"  class="form-control" placeholder="请输入促销说明" name="ext" id="ext">${promotionDetail.ext}</textarea>
			</div>
		</div>
		<div class="line line-dashed line-lg pull-in"></div>	
		<div class="form-group">
			<div class="col-sm-3">
				<label class="control-label" style="float: right;">促销备注</label>
			</div>
			<div class="col-sm-9">				
				<textarea rows="3" cols="5"  class="form-control" placeholder="请输入促销备注" name="ext1" id="ext1" >${promotionDetail.ext1}</textarea>
			</div>
		</div>
		
		</div>
		<footer class="panel-footer text-center bg-light lter">
		<button type="submit" class="btn btn-success btn-s-xl">保存</button>
		</footer> </section>
	</form>
	<script type="text/javascript">
		onloadurl();
	</script>
</body>
</html>